import axios from "../../requery/index"
//故障信息模块列表
export function fault_Table_List(data) {
    return axios({
        url: `/biz/mes-except/getExceptPageByAssemblyId`,
        method: "post",
        data,
        headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
    })
}
export function getWorkPageByAssemblyId(data) {
    return axios({
        url: `/biz/mesWorkpiece/getWorkPageByAssemblyId`,
        method: "post",
        data,
        headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
    })
}

//故障导入方案
export function inportExceptTileApi({ file, updateSupport }) {

    return axios({
        url: `/biz/mes-except/importData?&updateSupport=${updateSupport}`,
        method: 'post',
        data: file,
        headers: {
            'Content-Type': 'multipart/form-data'
        }
    })
}
//故障信息模块添加

export function saveExcept_list(data) {
    return axios({
        url: `/biz/mes-except/saveExcept`,
        method: "post",
        data,
        headers: { 'Content-Type': 'application/json' }
    })
}
//查看方案
export function getPlanPageByExcepId(data) {
    return axios({
        url: `/biz/mes-except/getExceptPageByAssemblyId`,
        method: "post",
        data,
        headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
    })
}


//修改方案
export function editPlan(data) {
    return axios({
        url: `/biz/mesResolvePlan/editPlan`,
        method: "put",
        data,
        headers: { 'Content-Type': 'application/json' }
    })
}

//获取工件零件部件列表
export function getWorkPage(data) {
    return axios({
        url: `/biz/mesWorkpiece/getWorkPage`,
        method: "post",
        data,
        headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
    })
}



export function getByExcepId({ workpieceId }) {
    return axios({
        url: `/biz/mesResolvePlan/getPlanPageByWorkpieceId/${workpieceId}`,
        method: "post",
        headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
    })
}




///故障模块修改
export function editExcept(data) {
    return axios({
        url: `/biz/mes-except/editExcept`,
        method: "put",
        data,
        headers: { 'Content-Type': 'application/json' }
    })
}

//删除工件零部件
export function editExcept_del_api(exceptId) {
    return axios({
        url: `/biz/mes-except/deledtExceptById/${exceptId.pkIds}`,
        method: "delete",
        headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
    })
}




//故障解决模块
export function tableListApi(data) {
    return axios({
        url: `/biz/mesResolvePlan/getPlansByAssemblyId`,
        method: "post",
        data,
        headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
    })
}


//故障解决下载文件方案
export function outFileApi(data) {
    return axios({
        url: `/biz/mesResolvePlan/export`,
        method: "post",
        responseType: "Blob",
        data,
        headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
    })
}



//故障解决添加方案
export function savePaln(data) {
    return axios({
        url: `/biz/mesResolvePlan/savePaln`,
        method: "post",
        data,
        headers: { 'Content-Type': 'application/json' }
    })
}
//关联
export function saveExceptPaln(data) {
    return axios({
        url: `/biz/mes-except-plan-xref/saveExceptPalns`,
        method: "post",
        data,
        headers: { 'Content-Type': 'application/json' }
    })
}
//故障解决删除方案

export function GetDelPlanById({ planId }) {
    return axios({
        url: `/biz/mesResolvePlan/deledtPlanById/${planId}`,
        method: "delete",
        headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
    })
}
//故障解决导入方案
export function addFileApi({ file, assemblyId, updateSupport }) {

    return axios({
        url: `/biz/mesResolvePlan/importData?&updateSupport=${updateSupport}`,
        method: 'post',
        data: file,
        headers: {
            'Content-Type': 'multipart/form-data'
        }
    })
}